﻿namespace Utility
{
    public class ResonResult : IResonResult
    {
        public ResonResult(IResonResult result)
        {
            Data = result.Data;
            Msg = result.Msg;
            Type = result.Type;
        }

        public ResonResult(string msg)
        {
            Msg = msg;
            Type = ResultType.error;
            Data = null;
        }

        public ResonResult(string msg, ResultType type)
        {
            Msg = msg;
            Type = type;
            Data = null;
        }

        public ResonResult(string msg, ResultType type, object data)
        {
            Msg = msg;
            Type = type;
            Data = data;
        }

        public ResultType Type { get; set; }

        public string Msg { get; set; }

        public object Data { get; set; }
    }
}